// 所有模块都通过 define 来定义
define(function (require, exports, module) {
var tpl_1 = require("/mobile/tpl/invest/myInvest.tpl");
	
	require('/plugins/extend/scrollView');
	require.async('common1', function () {
        $(".container").tabChange({
            isClick: true,
            isHover: false,
            childLi: ".productMenu span",//tab选项卡
            childContent: ".planFunBeans",//tab内容
            hoverClassName: "select",//选中当前选项卡的样式
            callBack: function(index){
            	/*if(index==0){
            		 ajaxPacket("/app/user/investList.html?borrowType=112&size=999&status=-1&category=99","get",tpl_1,"#qdinvestList");
            	}else{
            		 ajaxPacket("/app/user/investList.html?borrowType=103&size=999&status=-1&category=99","get",tpl_2,"#qyinvestList");
            	}*/
            }
        });
    });
	
	$("#qdinvestList").scrollView({
    	url:"/app/user/investList.html?size=5&status=-1&category=99",
    	type:"get",
    	tpl:tpl_1,
    	pernum:5
    });
    // 通过 require 引入依赖
    //require("/plugins/jquery.knob/jquery.knob.min");
   
    //ajaxPacket("/app/user/investList.html?borrowType=112&size=999&status=-1&category=99","get",tpl_1,"#qdinvestList");

    function ajaxPacket(url,type,tpl,container){
    	$.ajax({
            url: url,
            type: type,
            dataType: "json",
            success: function (data) {
                
                var template = Handlebars.compile(tpl);
                var html = template(data);
                $(container).html(html);
            }
        });
    }
    // 通过 exports 对外提供接口
    //exports.doSomething = ...

    // 或者通过 module.exports 提供整个接口
    //module.exports = ...
});